import { defineStore } from "pinia";
import { ref } from "vue";
// 动态
export const dynamicStore = defineStore('dynamic', () => {
    const dynamic = ref([])
    return {
        dynamic
    }
})

// 日记
export const publishStore = defineStore('publish', () => {
    const publish = ref([])
    return {
        publish
    }
})

// 文章
export const essayStore = defineStore('essay', () => {
    const essay = ref([])
    return {
        essay
    }
})




// 内容

// 动态
export const dynamicncStore = defineStore('dynamicnc', () => {
    let obj = JSON.parse(localStorage.getItem("user") || '{}');
    const dynamicnc = ref(obj.stat)
    return {
        dynamicnc
    }
})

// 日记
export const publishncStore = defineStore('publishnc', () => {
    let obj = JSON.parse(localStorage.getItem('user') || '{}')
    const publishnc = ref(obj.diary)
    return {
        publishnc
    }
})

// 文章
export const essayncStore = defineStore('essaync', () => {
    const essaync = ref([])
    return {
        essaync
    }
})